package test.y2019.august;

import learn.baidu.OnlyWord;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author 宋贤坤
 * @date 2019/8/6 14:53
 */
public class testLa {
    public static void main(String[] args) {

        OnlyWord onlyWord = new OnlyWord();
        List<OnlyWord> list = new ArrayList<>();
        list.add(onlyWord);

//        List<CompletableFuture<?>> futures =
//                IntStream.range(0, NUM_OF_CAKES)
//                        .mapToObj(id -> new CreateCakes(id))
//                        .map(CompletableFuture::supplyAsync)
//                        .thenApply(new FrostCakes())
//                        .thenAccept(new DecorateCakes())
//                        .collect(Collectors.toList());
//        futures.forEach(CompletableFuture::join);


        List<String> collect = list.stream().map(OnlyWord::getWord_name).collect(Collectors.toList());

        boolean b = list.stream().anyMatch(OnlyWord::getDisplay);

        Optional<OnlyWord> any = list.stream().findAny();
        OnlyWord onlyWord1 = any.get();

        List<Integer> collect1 = list.stream().map(OnlyWord::getId).collect(Collectors.toList());
        IntStream intStream = list.stream().mapToInt(OnlyWord::getId);
        int asInt = intStream.max().getAsInt();

    }
}
